#!/bin/bash
localtime=$(date +"%Y-%m-%d-%H:%M")
#$CI_COMMIT_MESSAGE为gitlab-runner内置变量
MESSAGE=$(echo ${CI_COMMIT_MESSAGE}) 
#$CI_COMMIT_AUTHOR同样也是gitlab-runner内置变量
AUTHOR=$(echo ${CI_COMMIT_AUTHOR}) 
curl "$FEISHU_WEBHOOK_CURL" -X POST -sH "Content-Type: application/json" -d '{"msg_type": "interactive", "card": {"config": {"wide_screen_mode": true},"header": {"title": {"tag": "plain_text","content": "项目发布通知"}},"elements": [{"tag": "div","fields": [{"is_short": true,"text": {"tag": "lark_md","content": "**项目: **'"$PROFILE_NAME"'\n**代码提交者: **'"$AUTHOR"'\n**描述: **'"$MESSAGE"'\n**环境: **'"$K8S_NS"'\n**集群: **'"$K8S_CLUSTER"'\n**上线时间: **'"$localtime"'\n**结果: **上线完成"}}]}]}}'
